package com.taiyi.renaissancemall.ui.mine.scores;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.taiyi.renaissancemall.R;
import com.taiyi.renaissancemall.bean.MyScoresBean;

import java.util.List;

public class MyScoresAdapter extends BaseQuickAdapter<MyScoresBean, BaseViewHolder> {
    public MyScoresAdapter(int layoutResId, @Nullable List<MyScoresBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyScoresBean item) {
        helper.setText(R.id.amountTv, item.money);
        helper.setText(R.id.sourceTv, item.title);
        helper.setText(R.id.dateTv, item.createtime);
        if ("1".equals(item.ftype)) {
            helper.setText(R.id.tv_where, R.string.scoreIssued);
        } else if ("2".equals(item.ftype)) {
            helper.setText(R.id.tv_where, R.string.scoreFrozen);
        } else if ("3".equals(item.ftype)) {
            helper.setText(R.id.tv_where, R.string.scoreExpired);
        }
    }
}
